#ifndef MODEL_WEEKLY_CALENDAR_RULE_HPP	
#define MODEL_WEEKLY_CALENDAR_RULE_HPP

#include "Model/Calendar.hpp"

namespace Model
{

	/// \brief It provides the mechanism for setting weekly recurrent time ranges.
	class MODEL_API WeeklyCalendarRule: public Calendar::Rule
	{
	public:
		WeeklyCalendarRule();

		/// \sa Calendar::Rule::getPeriods( const Calendar::Time&, const Calendar::Time&, Calendar::PeriodSet&);
		virtual void getPeriods( const Calendar::Time& start, const Calendar::Time& end, Calendar::PeriodSet& out);

		/// \param weekDay the number of the week day. 1 means Sunday, 7 means Saturday.
		void addWeekDay( unsigned int weekDay);

		/// \param weekDay the number of the week day. 1 means Sunday, 7 means Saturday.
		void removeWeekDay( unsigned int weekDay);

		/// \param weekDay the number of the week day. 1 means Sunday, 7 means Saturday.
		bool isWeekDayIncluded( unsigned int weekDay) const;

	private:
		unsigned char weekdayMap_;
	};

} // namespace Model

#endif // MODEL_WEEKLY_CALENDAR_RULE_HPP
